<template>
  <div
    class="c-node-card"
    :style="{ width: width, background: cardColor[card.imgurl] }"
  >
    <div class="top">
      <p class="time">{{ dateOne(card.moment) }}</p>
      <p class="lable">{{label[card.type][card.lable]}}</p>
    </div>
    <p class="message">
      {{ card.message }}
    </p>
    <div class="foot">
      <div class="foot-left">
        <div class="icon">
          <span class="iconfont icon-aixin1"></span>
          <span class="value">{{ card.like }}</span>
        </div>
        <div class="common">
          <span class="iconfont icon-liuyan"></span>
          <span class="value">{{ card.like }}</span>
        </div>
      </div>
      <div class="name">{{ card.name }}</div>
    </div>
  </div>
</template>

<script >
import { label, cardColor } from "@/static/data";
import { dateOne } from "@/static/getsj";
export default {
  data() {
    return {
      label,
      dateOne,
      cardColor,
    };
  },
  props: {
    width: {
      default: "100%",
    },
    note: {
      default: {},
    },
  },
  computed: {
    card(){
      return this.note;
    },
  },
};
</script>

<style lang="less" scoped>
.c-node-card {
  height: 230px;
  padding: 10px 20px 16px;
  box-sizing: border-box;
  position: relative;
  .top {
    display: flex;
    justify-content: space-between;
    padding-bottom: 16px;
    p {
      font-size: 10px;
      color: #949494;
    }
  }
  .message {
    height: 140px;
    font-size: 12px;
    color: #202020;
    cursor: pointer;
    font-family: "Courier New", Courier, monospace;
  }
  .foot {
    display: flex;
    justify-content: space-between;
    position: absolute;
    left: 0;
    bottom: 16px;
    box-sizing: border-box;
    width: 100%;
    padding: 0 20px;
    .foot-left {
      display: flex;
      .value {
        font-size: 12px;
        color: #949494;
        line-height: 16px;
        padding-left: 4px;
      }
      .iconfont {
        font-size: 16px;
        color: #949494;
      }
      .icon {
        padding-right: 8px;
        display: flex;
        align-items: center;
        .icon-aixin1 {
          cursor: pointer;
          transition: all 0.3s;
          &:hover {
            color: #f67770;
          }
        }
        .islike {
          color: #f67770;
        }
        .icon-liuyan {
          cursor: pointer;
        }
      }
    }
    .name {
      font-family: "Courier New", Courier, monospace;
      font-size: 16px;
      color: #202020;
    }
  }
}
</style>